<template>
    <div class="success-page">
        <div class="icon-wrapper">
            <van-icon name="success" class="check-icon" />
        </div>
        <div class="success-text">支付成功</div>
        <van-button type="primary" class="confirm-button" @click="onConfirm">
            确认
        </van-button>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const onConfirm = () => {
    // 示例：跳转或关闭
    console.log('确认按钮点击')
    router.push('/code-page')
}
</script>

<style scoped>
.success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
    margin-top: -10rem;
}

.icon-wrapper {
    width: 100px;
    height: 100px;
    background-color: #07c160; /* Vant 绿色 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.check-icon {
    font-size: 60px;
    color: white;
}

.success-text {
    font-size: 24px;
    color: #333;
    margin-bottom: 40px;
}

.confirm-button {
    width: 80%;
}
</style>
